def new() -> object:
    """

    :rtype: object
    """
    judge = input('输入你的选择:')
    judge_arg = judge.upper()
    if judge_arg == 'A':  # 新建
        name = input(r'Please input the file name:')
        print('The new file complete.')
        if name == None:
            print('你输入的文件名有误,请重新输入')
            new()
        else: pass
        file = open('D:/practice/{}.txt'.format(name), 'w', encoding='utf8')
        file.write('姓名\tID\t\t成绩\n')
    elif judge_arg == 'B':
        name = open("d:/practice/old_name.txt", 'r', encoding='utf8').read()
        if name == '':
            print('您这是第一次使用,请选择A')
            new()
        else:
            print(name)
            file = open('D:/practice/{}.txt'.format(name), 'w', encoding='utf8')
            judge = input('Do you want to have a clean file(Y/N):')
            judge_arg = judge.upper()
            if judge_arg == 'Y':
                file.write('姓名\tID\t\t成绩\n')
                print('Complete')
            else:
                file.close()
                print('没有清空原有数据')
                print('*' * 50)
    else:
        print('Your enter is wrong')
        new()

    file = open('D:/practice/{}.txt'.format(name), 'r+', encoding='utf8')
    if file.read() == '':
        file.write('姓名\tID\t\t成绩\n')
        print('这是新文件,强制格式化')
        file.close()
    else:
        None

    print('*' * 50)
    print('初始化完成')
    open('D:/practice/old_name.txt', "w", encoding='utf8').write(name)
    print("你将在{}中进行工作,".format(name))
    return name
